home *** CD-ROM | disk | FTP | other *** search
/ Aminet 43 / Aminet 43 (2001)(GTI - Schatztruhe)[!][Jun 2001].iso / Aminet / comm / tcp / Amster-main.lha / Amster_Install / Rexx / Whois_example.rexx < prev    next >
OS/2 REXX Batch file  |  2000-08-22  |  2KB  |  67 lines

  1. /*
  2. ** Amster WhoIs Demo
  3. **
  4. ** Usage: RX Whois_example <nick>
  5. */
  6.  
  7. parse arg String
  8. address 'AMSTER.1'
  9.  
  10. Link.0  = "Unknown"
  11. Link.1  = "14.4K Modem"
  12. Link.2  = "28.8K Modem"
  13. Link.3  = "33.6K Modem"
  14. Link.4  = "56K Modem"
  15. Link.5  = "ISDN 64K"
  16. Link.6  = "ISDN 128K"
  17. Link.7  = "Cable"
  18. Link.8  = "DSL"
  19. Link.9  = "T1"
  20. Link.10 = "T3+"
  21.  
  22. ISONLINE
  23. if RC = 0 then CONNECT
  24. ISONLINE
  25.  
  26. do while RC = 0
  27.    call delay(50)
  28.    ISONLINE
  29. end
  30.  
  31. WHOIS String 'LUSER'
  32. if RC = 0 then do
  33.   Speed = LUSER.LINK
  34.   Hours = LUSER.TIME % 3600
  35.   Minutes = (LUSER.TIME % 60) - (Hours * 60)
  36.   Seconds = LUSER.TIME - (Hours * 3600) - (Minutes * 60)
  37.   OnlineTime = Hours":"Right("00"||Minutes,2)":"Right("00"||Seconds,2)
  38.  
  39.   say 'WHOIS'
  40.   say '-----'
  41.   say 'Nick:      'LUSER.NICK
  42.   say 'Level:     'LUSER.LEVEL
  43.   say 'Time:      'OnlineTime
  44.   say 'Channels:  'LUSER.CHANNELS
  45.   say 'Status:    'LUSER.STATUS
  46.   say 'Shares:    'LUSER.SHARES
  47.   say 'Downloads: 'LUSER.DOWNLOADS
  48.   say 'Uploads:   'LUSER.UPLOADS
  49.   say 'Link:      'Link.Speed
  50.   say 'Client:    'LUSER.CLIENT
  51. end
  52. else if RC = 1 then do
  53.   Logoff = Date('N',LUSER.LASTSEEN % (60*60*24), 'I')
  54.   ElapSec = ((LUSER.LASTSEEN / (60*60*24)) - (LUSER.LASTSEEN % (60*60*24))) * 60 * 60 * 24 % 1
  55.   Hours = ElapSec % 3600
  56.   Minutes = (ElapSec % 60) - (Hours * 60)
  57.   Seconds = ElapSec - (Hours * 3600) - (Minutes * 60)
  58.   OfflineTime = Hours":"Right("00"||Minutes,2)":"Right("00"||Seconds,2)
  59.  
  60.   say 'WHOWAS'
  61.   say '------'
  62.   say 'Nick:      'LUSER.NICK
  63.   say 'Level:     'LUSER.LEVEL
  64.   say 'Last seen: 'Logoff" "OfflineTime
  65. end
  66. else say 'Failed!'
  67.